import React from 'react';
import { isH5Mobile } from '@block/utils';
import { MModal } from '@block/mobile-plug';
import { RiskImgData } from '../../type';
import './RiskLevelModal.scss';

interface Props {
  onClose: () => void;
  riskImg: RiskImgData;
}

/**
 * 风险等级定义弹窗
 * pc端为弹出框&h5为上滑抽屉
 */

const RiskLevelModal = (props: Props) => {
  const { onClose, riskImg } = props;

  return (
    <MModal title="风险等级定义" mode="modal2drawer" className="modal-content" onClose={onClose}>
      <MModal.Body>
        <img
          className="modal-content-img"
          src={isH5Mobile() ? riskImg?.mobileFileUrl : riskImg?.pcFileUrl}
          alt="风险等级定义"
        />
      </MModal.Body>
    </MModal>
  );
};
export default RiskLevelModal;
